﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OS.GenericDashboardViewer.Interfaces;
using OS.GenericDashboardViewer.DataModel;
using OS.GenericDashboardViewer.Infrastructure;

namespace OS.GenericDashboardViewer.BL
{
    
    public class PartViewsConfigurationMgr : IPartViewsConfigurationMgr
    {
        private const string CONFIG_FILE_NAME = "viewParts.xml";
        public IViewPartsConfiguration LoadViewPartsConfiguration()
        {
            var derivedTypes = (from type in this.GetType().Assembly.GetTypes()
                                where type.BaseType == typeof(ViewPart)
                                select type).ToArray();


            return SerializeHelper.DeserializeFromFile<ViewPartsConfiguration>("viewParts.xml", derivedTypes);

           
        }
    }
}
